package cn.jiyun.JiaQi_1_21;

import cn.jiyun.JiaQi_1_21.impl.Apple;
import cn.jiyun.JiaQi_1_21.impl.Orange;
import cn.jiyun.JiaQi_1_21.inter.Fruit;

public class Factory {
    public static Fruit getInstance(String fruitName){
        Fruit f= null;
        if ("Apple".equals(fruitName)){
            f=new Apple();
        }
        if ("Orange".equals(fruitName)){
            f=new Orange();
        }
        return f;
    }
}
